 <div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
     <?php if(isset($planMsg) OR $this->session->flashdata('planMsg')!='' OR $this->session->flashdata('vendorplanMsg')!='' ){ ?>
          <p style="text-align: center;color: #F44336;"><?php echo isset($planMsg) ? $planMsg : '' ;
			    $m = $this->session->flashdata('planMsg');
			    echo ($m) ? $this->session->flashdata('planMsg') : '' ;
			    echo '<br/>';
			    $vm = $this->session->flashdata('vendorplanMsg');
			    echo ($vm) ? $this->session->flashdata('vendorplanMsg') : '' ;
				?>
				<?php
				    if($this->ts_functions->getsettings('portal','revenuemodel') == 'subscription' ) {
                        if( $this->session->userdata['ts_planstatus'] == '0' ) {
                            echo 'Your current plan expired, renew to access products.';
                        }
				    }
				?>
				</p>
	 <?php } ?>		
				<div class="tp_cartdiv tp_purchased_table">
					<table class="table">
						<tr>
						    <th><i class="fa fa-picture-o" aria-hidden="true"></i></th>
							<th><?php echo $this->ts_functions->getlanguage('producttext','userdashboard','solo');?></th>
							<th><?php echo $this->ts_functions->getlanguage('datetext','userdashboard','solo');?></th>
							<th><?php echo $this->ts_functions->getlanguage('purchasecodetext','userdashboard','solo');?></th>
							<th><?php echo $this->ts_functions->getlanguage('downloadtext','userdashboard','solo');?></th>
						</tr>
						<?php if(!empty($purchasedDetails)) {
					    foreach($purchasedDetails as $soloProd) {

					    $prodUniqid = $soloProd['prod_uniqid'];
					    $uid = $this->session->userdata('ts_uid');
                        $checkAvail = $this->ts_functions->checkproductavailablility($prodUniqid,$uid);

                        $transactionDetails = $this->DatabaseModel->access_database('ts_paymentdetails','select','',array('payment_uid'=>$uid,'payment_status'=>'yes'));
                        $purCodeText = '';
                        foreach($transactionDetails as $solo_transaction) {
                            $aArr = explode($prodUniqid,$solo_transaction['payment_pid']);
                            if( count($aArr) > 1 ) {
                                $purCodeText = $solo_transaction['payment_uniqid'];
                            }
                        }
                        
					   $prodName = $this->ts_functions->getProductName($soloProd['prod_id']);
		        		$prodImage = $this->ts_functions->getProductPic($soloProd['prod_image']);
						$prodLink = $basepath.'item/'.$prodName.$soloProd['prod_uniqid'];
						$purchaseDate= isset($dateofplan) ? $dateofplan : date_format(date_create ( $soloProd['purrec_date'] ) , 'M d, Y') ; 
                    ?>
						<tr>
							<td><span><img src="<?php echo $prodImage; ?>" class="img-responsive" alt="" style="width: 150px;"></span></td>
							<td><h4><a href="<?php echo $prodLink; ?>"><?php echo $soloProd['prod_name'];?></a></h4></td>
							<td><p><?php echo $purchaseDate ; ?></p></td>
							<td><p><b><?php echo ($purCodeText == '') ? '-' : $purCodeText; ?></b></p></td>
							
							<?php
							    if( isset($dateofplan) ) {
							        $fun = 'free_download_product';
							        $this->session->userdata['is_free']= 'yes';
							    }
							    else {
							        $fun = 'download_product' ;
							        $this->session->userdata['is_free']= 'no';
							    }

							?>
                            <?php
                           $dUrl = '<td><span><a href="'. $basepath.'dashboard/'.$fun.'/'.$soloProd['prod_uniqid'].'" target="_blank"><i class="fa fa-download" aria-hidden="true"></i></a> ';
							if( $soloProd['prod_downloadpassword'] != '' ) { 
								$dUrl .= '<b>( '.$soloProd['prod_downloadpassword'].' )</b>';
							}
							$dUrl .= '</span></td>';

							echo ( $checkAvail == '1' ) ? $dUrl : '<td><span><i class="fa fa-ban" aria-hidden="true"></i></span> </td>' ;?>
						</tr>
					<?php }
						}else{?>
							<tr class="tp_nodata">
								<td colspan="5" align="center"> <?php echo $this->ts_functions->getlanguage('emptyproducttext','userdashboard','solo');?></td>
							</tr>
						<?php } ?>	
						
					</table>
				</div>
			</div>
		</div>
	</div>
</div>